﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Training.Library.DataAccess.Administration.Catalog;
using System.Configuration;
using Microsoft.Reporting.WebForms;


namespace Training.Web.Reports 
{

    public partial class rptPembicaraList : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PembicaraRepo PembicaraDal = new PembicaraRepo(ConfigurationManager.ConnectionStrings["TrainingConn"].ConnectionString);
                DataTable dt = PembicaraDal.GetDataTableReport();

                rsViewer.Reset();
                rsViewer.LocalReport.ReportPath = Server.MapPath("~/reportviewer/rptPembicara.rdlc");
                ReportDataSource rds = new ReportDataSource();
                rds.Name = "DataSet1";
                rds.Value = dt;

                rsViewer.LocalReport.DataSources.Clear();
                rsViewer.LocalReport.DataSources.Add(rds);
                rsViewer.LocalReport.Refresh();

                //rsViewer.SetExportFormatVisibility(ReportViewerExportFormat.Excel, false);
                //rsViewer.SetExportFormatVisibility(ReportViewerExportFormat.Word, false);
            }
        }
    }
}